package com.cqut.ktpspring.service.impl;
import com.cqut.ktpspring.mapper.UserMapper;
import com.cqut.ktpspring.pojo.User;
import com.cqut.ktpspring.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceimpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User findByUid(String id) {
        return userMapper.selectById(id);
    }

    @Override
    public void update(User user) {
        userMapper.updateById(user);
    }

    @Override
    public List<User> getAll() {
       return userMapper.selectList(null);
    }
}
